<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="UTF-8">
		<title>添加商品</title>
		<link type="text/css" rel="stylesheet" href="/fontsawesome/css/font-awesome.css"/>
		<link type="text/css" rel="stylesheet" href="/css/style.css"/>
		<style>
		.ss_box{position:relative;display:inline-block;width:calc(30% + 24px);}
		.ss_box dl{position:absolute;top:36px;left:0;width:100%;max-height:200px;background-color:#fff;border:1px solid #ddd;overflow:auto;display:none;}
		.ss_box dt{padding:10px;}
		.ss_box dd{padding:5px 10px;cursor:context-menu;}
		.ss_box dd:hover{background-color:#ddd;}
		</style>
	</head>
	<body>
		<div class="main_box">
			<h2><span></span>添加商品</h2>
			<div class="cont_box">
				<form method="post" id="addCommo_form">
					<ul class="addpro_box">
						<li>
							<label>供货商编号：</label>
							<input type="text" name="providerId" th:value="${providerId}" readonly/>
						</li>
						<li>
							<label>商品名称：</label>
							<input type="text" name="name"  placeholder="请输入商品名称" required
								   data-rule-name="true"/>
						</li>
						<li>
							<label>所属分类：</label>
							<select name="type">
								<option th:each="t : ${typeList}" th:value="${t.id}" th:text="${t.stateName}"
										th:selected="${t.id == 0}"></option>
							</select>
						</li>
						<li>
							<label>批发价格：</label>
							<input type="text" placeholder="请输入批发价格" name="price" required
								   data-rule-pricein="true" data-msg-required="商品售价不能为空"/>
						</li>
						<li>
							<label>仓库库存：</label>
							<input type="text" name="amount" placeholder="请输入仓库库存" required
								   data-rule-digits="true" data-msg-required="商品库存不能为空，无库存请填“0”" data-msg-digits="请输入正整数"/>
						</li>
						<li>
							<label>商品描述：</label>
							<textarea name="describes"  placeholder="请输入商品描述" ></textarea>
						</li>

					</ul>

					<div class="probtn_box clearfix">
						<input type="button" value="添加商品" class="btn blue_btn submit"/>
					</div>
				</form>
			</div>
		</div>
		<!--javascript include-->
		<script src="/js/jquery-2.2.1.min.js"></script>
		<script src="/js/jquery.dataTables.min.js"></script>
		<script src="/js/bootstrap-datepicker.js"></script>
		<script src="/js/jquery.validate.min.js"></script>
		<script src="/js/jquery.form.min.js"></script>
		<script src="/js/other.js"></script>

		<script>
			$(function(){
				$("body").other({formId:"#addCommo_form",formUrl:"/commodity/add"});//formUrl 表单请求地址

			});
		</script>
	</body>
</html>
